export const completion = {
    tooltip: {
        show: false
    },
    series: [
        {
            name: "",
            type: "pie",
            radius: ["100%", "90%"],
            avoidLabelOverlap: false,
            label: {
                show: true,
                position: "center",
                formatter: () => [`{a|${20}%}`, `{b|整机}`].join("\n"),
                rich: {
                    a: {
                        color: "#4BA6DD",
                        fontSize: "20px",
                        height: "40"
                    },
                    b: {
                        color: "#9CA8B2",
                        fontSize: "12px"
                    }
                }
            },
            data: [],
            emphasis: {
                disabled: true
            }
        }
    ]
};

export const lineOption = {
    grid: {
        top: 30,
        bottom: 50,
        left: 50,
        right: 20
    },
    xAxis: {
        type: "category",
        boundaryGap: false,
        data: [],
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        axisLabel: {
            fontSize: 10,
            color: "#d6dde9"
        },
        boundaryGap: ["10%"]
    },
    yAxis: {
        type: "value",
        splitNumber: "2",
        splitLine: {
            lineStyle: {
                type: "dashed",
                color: "#487187"
            }
        },
        axisLabel: {
            fontSize: 10,
            textStyle: {
                color: "#BFBFBF"
            }
        },
        name: "{a|应变}",
        nameTextStyle: {
            color: "#BFBFBF",
            rich: {
                a: {
                    width: 90,
                    align: "left"
                }
            }
        }
    },
    series: [
        {
            data: [120, 132, null, 134, 90, 230, 210],
            type: "line",
            lineStyle: {
                color: "#4BA6DD"
            },
            symbol: "none"
        }
    ]
};

export const maintenanceOption = {
    tooltip: {
        show: false
    },
    series: [
        {
            name: "",
            type: "pie",
            radius: ["100%", "90%"],
            avoidLabelOverlap: false,
            label: {
                show: true,
                position: "center",
                verticalAlign: "top",
                padding: [0, 0, 8, 0],
                formatter: () => {},
                rich: {
                    a: {
                        color: "#4BA6DD",
                        fontSize: "25px"
                    },
                    b: {
                        color: "#9CA8B2",
                        fontSize: "16px",
                        lineHeight: "25"
                    }
                }
            },
            data: [
                {
                    value: 10,
                    itemStyle: {
                        color: {
                            type: "linear",
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [
                                {
                                    offset: 0,
                                    color: "#3EA8DE"
                                },
                                {
                                    offset: 1,
                                    color: "#106EB8"
                                }
                            ],
                            global: false // 缺省为 false
                        }
                    }
                },
                { value: 4, itemStyle: { color: "transparent" } }
            ],
            emphasis: {
                disabled: true
            },
            startAngle: -140
        }
    ]
};

export const maintenanceLineOption = {
    xAxis: {
        type: "category",
        data: ["已报修", "待实施"],
        axisLabel: {
            color: "#fff",
            margin: 12
        },
        axisLine: {
            show: false
        },
        axisTick: {
            show: false
        }
    },
    grid: {
        top: 30,
        left: 0,
        right: 0,
        bottom: 30
    },
    yAxis: {
        type: "value",
        show: false
    },
    series: [
        {
            z: 1,
            name: "数据",
            type: "bar",
            barWidth: 20,
            barGap: "0%",
            label: {
                show: true,
                color: "#8E98BA",
                position: "top",
                distance: 10
            },
            data: [
                {
                    value: 20,
                    itemStyle: {
                        normal: {
                            color: {
                                type: "linear",
                                x: 0,
                                x2: 1,
                                y: 0,
                                y2: 0,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#1274FD"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#1274FD"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#0B65E2"
                                    },
                                    {
                                        offset: 1,
                                        color: "#0B65E2"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    value: 30,
                    itemStyle: {
                        normal: {
                            color: {
                                type: "linear",
                                x: 0,
                                x2: 1,
                                y: 0,
                                y2: 0,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#F3D94C"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#F3D94C"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#CCB748"
                                    },
                                    {
                                        offset: 1,
                                        color: "#CCB748"
                                    }
                                ]
                            }
                        }
                    }
                }
            ]
        },
        {
            z: 2,
            name: "数据",
            type: "pictorialBar",
            data: [
                {
                    value: 1,
                    itemStyle: {
                        normal: {
                            color: {
                                type: "linear",
                                x: 0,
                                x2: 1,
                                y: 0,
                                y2: 0,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#1274FD"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#1274FD"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#0B65E2"
                                    },
                                    {
                                        offset: 1,
                                        color: "#0B65E2"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    value: 1,
                    itemStyle: {
                        normal: {
                            color: {
                                type: "linear",
                                x: 0,
                                x2: 1,
                                y: 0,
                                y2: 0,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#F3D94C"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#F3D94C"
                                    },
                                    {
                                        offset: 0.5,
                                        color: "#CCB748"
                                    },
                                    {
                                        offset: 1,
                                        color: "#CCB748"
                                    }
                                ]
                            }
                        }
                    }
                }
            ],
            symbol: "diamond",
            symbolOffset: ["0%", "50%"],
            symbolSize: [20, 10],
            tooltip: {
                show: false
            }
        },
        {
            z: 3,
            name: "数据",
            type: "pictorialBar",
            symbolPosition: "end",
            data: [
                {
                    value: 20,
                    itemStyle: {
                        normal: {
                            borderColor: "#3E8FFF",
                            borderWidth: 2,
                            color: "#3E8FFF"
                        }
                    }
                },
                {
                    value: 30,
                    itemStyle: {
                        normal: {
                            borderColor: "#FFE975",
                            borderWidth: 2,
                            color: "#FFE975"
                        }
                    }
                }
            ],
            symbol: "diamond",
            symbolOffset: ["0%", "-60%"],
            symbolSize: [20, 8],
            tooltip: {
                show: false
            }
        }
    ]
};
